dbus: fix ujail configuration
authorBjørn Mork <[email protected]>
Tue, 5 Aug 2025 15:34:42 +0000 (17:34 +0200)
committerRobert Marko <[email protected]>
Thu, 14 Aug 2025 08:58:04 +0000 (10:58 +0200)
commit2749f0a3af09e02d4540ec6e624794c693bf9f4f
treed9abf45b3365d212cdbdeffe224c56047db1cfc7
parent8b84b03b94f179064219636e5c410efa30b44466
dbus: fix ujail configuration

Running dbus as an unprivileged user fails for two reasons: Cannot write pid file
and cannot read the installed policies:

 Tue Aug  5 17:12:41 2025 daemon.info dbus-daemon[8568]: jail: exec-ing /usr/bin/dbus-daemon
 Tue Aug  5 17:12:41 2025 daemon.info dbus-daemon[8585]: Encountered error 'Failed to open "/etc/dbus-1/system.d/org.freedesktop.ModemManager1.conf": Permission denied' while parsing '/etc/dbus-1/system.d/org.freedesktop.ModemManager1.conf'
 Tue Aug  5 17:12:41 2025 daemon.err dbus-daemon[8568]: dbus-daemon[8585]: Encountered error 'Failed to open "/etc/dbus-1/system.d/org.freedesktop.ModemManager1.conf": Permission denied' while parsing '/etc/dbus-1/system.d/org.freedesktop.ModemManager1.conf'
 Tue Aug  5 17:12:41 2025 daemon.warn dbus-daemon[8585]: Failed to start message bus: Failed to open "/var/run/dbus.pid": Permission denied
 Tue Aug  5 17:12:41 2025 daemon.err dbus-daemon[8568]: dbus-daemon[8585]: Failed to start message bus: Failed to open "/var/run/dbus.pid": Permission denied
 Tue Aug  5 17:12:41 2025 daemon.info dbus-daemon[8568]: jail: jail (8585) exited with exit: 1

Fix by dropping the pid file when running unprivileged and changing the owner
of the installed policies.

Fixes: f238d6dd0996 ("dbus: run as regular user rather than as root")
Signed-off-by: Bjørn Mork <[email protected]>
utils/dbus/Makefile
utils/dbus/files/dbus.init